package prueba;

import javax.microedition.midlet.*; 
import javax.microedition.lcdui.*; 
 
public class Canvas1 extends MIDlet implements CommandListener { 
 
 private Command exitCommand; 
 private Display display; 
 private SSCanvas2 screen; 
 
 public Canvas1() { 
  display=Display.getDisplay(this); 
  exitCommand = new Command("Salir",Command.SCREEN,2); 
 
  screen=new SSCanvas2(); 
  screen.addCommand(exitCommand); 
  screen.setCommandListener(this); 
 } 
  
 public void startApp() throws MIDletStateChangeException { 
  display.setCurrent(screen); 
 } 
 
 public void pauseApp() {} 
 
 public void destroyApp(boolean unconditional) {} 
 
 public void commandAction(Command c, Displayable s) { 
 
  if (c == exitCommand) { 
    destroyApp(false); 
    notifyDestroyed(); 
  } 
 
 } 
  
} 
 